package net.ib.mtalk.ui.attachment.vcard;

import net.ib.mtalk.R;
import android.provider.ContactsContract;

/**
 * 주소록 타입별로 필드네임을 리소스로 지정한다.
 * 
 * @author happy2v
 *
 */
public class VCardConst {
	
	/**
	 * Phone 의 타입별로 Res 의 주소 값을 반환한다.
	 * @param type
	 * @return
	 */
	public static int getPhoneTypeRes(int type){
		switch(type){
			case ContactsContract.CommonDataKinds.Phone.TYPE_ASSISTANT:
				return R.string.vcard_phone_type_assistant;
			case ContactsContract.CommonDataKinds.Phone.TYPE_CALLBACK:
				return R.string.vcard_phone_type_callback;
			case ContactsContract.CommonDataKinds.Phone.TYPE_CAR:
				return R.string.vcard_phone_type_car;
			case ContactsContract.CommonDataKinds.Phone.TYPE_COMPANY_MAIN:
				return R.string.vcard_phone_type_main;
			case ContactsContract.CommonDataKinds.Phone.TYPE_FAX_HOME:
				return R.string.vcard_phone_type_fax_home;
			case ContactsContract.CommonDataKinds.Phone.TYPE_FAX_WORK:
				return R.string.vcard_phone_type_fax_work;
			case ContactsContract.CommonDataKinds.Phone.TYPE_HOME:
				return R.string.vcard_phone_type_home;
			case ContactsContract.CommonDataKinds.Phone.TYPE_ISDN:
				return R.string.vcard_phone_type_isdn;
			case ContactsContract.CommonDataKinds.Phone.TYPE_MAIN:
				return R.string.vcard_phone_type_main;
			case ContactsContract.CommonDataKinds.Phone.TYPE_MMS:
				return R.string.vcard_phone_type_mms;
			case ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE:
				return R.string.vcard_phone_type_mobile;
			case ContactsContract.CommonDataKinds.Phone.TYPE_OTHER:
				return R.string.vcard_phone_type_other;
			case ContactsContract.CommonDataKinds.Phone.TYPE_OTHER_FAX:
				return R.string.vcard_phone_type_other_fax;
			case ContactsContract.CommonDataKinds.Phone.TYPE_PAGER:
				return R.string.vcard_phone_type_pager;
			case ContactsContract.CommonDataKinds.Phone.TYPE_TELEX:
				return R.string.vcard_phone_type_telex;
			case ContactsContract.CommonDataKinds.Phone.TYPE_TTY_TDD:
				return R.string.vcard_phone_type_tty_tdd;
			case ContactsContract.CommonDataKinds.Phone.TYPE_WORK:
				return R.string.vcard_phone_type_work;
			case ContactsContract.CommonDataKinds.Phone.TYPE_WORK_MOBILE:
				return R.string.vcard_phone_type_work_mobile;
			case ContactsContract.CommonDataKinds.Phone.TYPE_WORK_PAGER:
				return R.string.vcard_phone_type_work_pager;
			default:
				return R.string.vcard_phone_type_other;
		}
	}
	
	/**
	 * Email 의 타입별로 Res 의 주소 값을 반환한다.
	 * @param type
	 * @return
	 */
	public static int getEmailTypeRes(int type){
		switch(type){
			case ContactsContract.CommonDataKinds.Email.TYPE_HOME:
				return R.string.vcard_email_type_home;
			case ContactsContract.CommonDataKinds.Email.TYPE_MOBILE:
				return R.string.vcard_email_type_mobile;
			case ContactsContract.CommonDataKinds.Email.TYPE_OTHER:
				return R.string.vcard_email_type_other;
			case ContactsContract.CommonDataKinds.Email.TYPE_WORK:
				return R.string.vcard_email_type_work;
			case ContactsContract.CommonDataKinds.Email.TYPE_CUSTOM:
				return R.string.vcard_email_type_custom;
			default:
				return R.string.vcard_email_type_custom;
		}
	}
	
	/**
	 * 주소(Postal) 의 타입별로 Res 의 주소 값을 반환한다.
	 * @param type
	 * @return
	 */
	public static int getPostalTypeRes(int type){
		switch(type){
			case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_HOME:
				return R.string.vcard_postal_type_home;
			case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_OTHER:
				return R.string.vcard_postal_type_other;
			case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK:
				return R.string.vcard_postal_type_work;
			case ContactsContract.CommonDataKinds.StructuredPostal.TYPE_CUSTOM:
				return R.string.vcard_postal_type_custom;
			default:
				return R.string.vcard_postal_type_custom;
		}
	}
	
	/**
	 * 메신져(Im) 의 타입별로 Res 의 주소 값을 반환한다.
	 * @param type
	 * @return
	 */
	public static int getImTypeRes(int type){
		switch(type){
			case ContactsContract.CommonDataKinds.Im.TYPE_HOME:
				return R.string.vcard_im_type_home;
			case ContactsContract.CommonDataKinds.Im.TYPE_OTHER:
				return R.string.vcard_im_type_other;
			case ContactsContract.CommonDataKinds.Im.TYPE_WORK:
				return R.string.vcard_im_type_work;
			case ContactsContract.CommonDataKinds.Im.TYPE_CUSTOM:
				return R.string.vcard_im_type_custom;
			default:
				return R.string.vcard_im_type_custom;
		}
	}
	
	/**
	 * 메신져(Im) 의 프로토콜 별로 Res 의 주소 값을 반환한다.
	 * @param type
	 * @return
	 */
	public static int getImProtocolRes(int type){
		switch(type){
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_AIM:
				return R.string.vcard_im_protocol_aim;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_CUSTOM:
				return R.string.vcard_im_protocol_custom;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_GOOGLE_TALK:
				return R.string.vcard_im_protocol_google_talk;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_ICQ:
				return R.string.vcard_im_protocol_icq;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_JABBER:
				return R.string.vcard_im_protocol_jabber;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_MSN:
				return R.string.vcard_im_protocol_msn;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_NETMEETING:
				return R.string.vcard_im_protocol_netmeeting;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_QQ:
				return R.string.vcard_im_protocol_qq;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_SKYPE:
				return R.string.vcard_im_protocol_skype;
			case ContactsContract.CommonDataKinds.Im.PROTOCOL_YAHOO:
				return R.string.vcard_im_protocol_yahoo;
			default:
				return R.string.vcard_im_protocol_custom;
		}
	}
	
	/**
	 * 조직도(Organization) 의 타입별로 Res 의 주소 값을 반환한다.
	 * @param type
	 * @return
	 */
	public static int getOrganizationTypeRes(int type){
		switch(type){
			case ContactsContract.CommonDataKinds.Organization.TYPE_OTHER:
				return R.string.vcard_organization_type_other;
			case ContactsContract.CommonDataKinds.Organization.TYPE_WORK:
				return R.string.vcard_organization_type_work;
			case ContactsContract.CommonDataKinds.Organization.TYPE_CUSTOM:
				return R.string.vcard_organization_type_custom;
			default:
				return R.string.vcard_organization_type_custom;
		}
	}
}
